<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!--引用CW标签  -->
<%@ taglib uri="/WEB-INF/taglib/cw" prefix="CW"%>
<!--引用struts标签  -->
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<base href="<%=basePath%>">
	<title></title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath%>css/en/edit.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="<%=basePath%>js/commons/common_edit.js"></script>
</head>
<body>
	<jsp:include page="../../common/loadingPage.jsp" />
	<div class="writetblbox">
		<table class="writetbl">
			<tr>
				<td style="width:50%;padding-top:100px;padding-bottom:100px;">
					<div style="width:100%;text-align: center;font-size: 16px;padding-top:20px;padding-bottom:20px">
						添加邀请码，绑定商户。
					</div>
					<div style="width:100%;text-align: center;font-size:15px;">
						邀请码：<input type="text" id="invitation" style="width:60%"> 
					</div>
					<div style="width:100%;text-align: center;margin-top:40px;">
						<input class="okbtn" type="button" value="绑定" onclick="__submit()" style="height:60px;font-size:16px;"> 
					</div>
				</td>
				<td style="width:50%;padding-top:100px;padding-bottom:100px;">
					<div style="width:100%;text-align: center;font-size: 16px;padding-top:20px;padding-bottom:20px">
						创建商户，该账号将成为创建商户管理员账号，拥有最高权限。
					</div>
					<div style="width:100%;text-align: center;margin-top:40px;">
						<input class="okbtn" type="button" value="创建商户" onclick="__gotoAdd()" style="width:120px;height:60px;font-size:16px;"> 
					</div>
				</td>
			</tr>
		</table>
	</div>
	<span class="_height"></span>
	<script type="text/javascript">
		function __submit(){
			$.ajax({  
			    type: "post",  
			    async: false,
			    url: "<%=basePath%>shopAjax/insertByCode.action",  
			    data: "invitation=" + $("#invitation").val() ,  
			    success: function(data){
			    	if(data=='fasle'){//重复
					    art.dialog.alert('邀请码无效！');
			    	}else if(data=='error'){
			    		art.dialog.alert('系统繁忙，请稍后再试！');
			    	}else{
			    		art.dialog.alert('绑定成功！');
			    		parent.location.href="<%=basePath%>loginAction/checked.action";
			    	}
			    }
			});
		}
		function __gotoAdd(){
			window.location.href="<%=basePath%>shop/gotoAdd.action";
		}
	</script>
</body>
</html>
